Testing some geometry routines in C++
[andmenj-acm.git] / 10198 - Counting / Main.java
blobd247173918dfb17fec8e50e62987d1a1c092bba2
1 import java.io.*;
2 import java.math.*;
4 public class Main{
5 public static void main(String args[]) throws Exception{
6 BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));
8 BigInteger dp[] = new BigInteger[1010];
9 for (int i=0; i<1010; ++i) dp[i] = BigInteger.ZERO;
10 dp[0] = BigInteger.ONE;
11 for (int i=0; i<=1000; ++i){
12 dp[i+1] = dp[i+1].add(dp[i]);
13 dp[i+1] = dp[i+1].add(dp[i]);
14 dp[i+2] = dp[i+2].add(dp[i]);
15 dp[i+3] = dp[i+3].add(dp[i]);
17 String s;
18 while ((s = cin.readLine()) != null){
19 System.out.println(dp[Integer.parseInt(s)].toString());